<?php /* Smarty version Smarty-3.1.14, created on 2017-08-25 11:58:48
         compiled from "E:\phpStudy\WWW\zyshop\admin\templates\nav_list.html" */ ?>
<?php /*%%SmartyHeaderCode:194085994fee3492447-38018473%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '0ceeca801a29b43b1f77bebef172db2ebad1ec95' => 
    array (
      0 => 'E:\\phpStudy\\WWW\\zyshop\\admin\\templates\\nav_list.html',
      1 => 1503633526,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '194085994fee3492447-38018473',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.14',
  'unifunc' => 'content_5994fee34da148_81734043',
  'variables' => 
  array (
    'nav_list' => 0,
    'list' => 0,
    'page' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5994fee34da148_81734043')) {function content_5994fee34da148_81734043($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<style>
th{ text-align:left;}
</style>
<body>
<div class="fixed-bar">
  <div class="item-title">
    <h3>自定义导航</h3>
    <div style="background:rgba(251,112,45,1);width:125px;height:40px;float:right;text-align:center;border-radius:5px;">
          <a href="nav_list.php?act=add">
            <h5 style="padding:10px;color:#fff;">添加导航</h5>
          </a>
    </div>
  </div>
</div>
<div class="fixed_bottom">
    <table align="center;" class="table tb-type2">
      <thead>
        <tr>
          <th width="10"></th>
          <th width="50"><a>编号</a></th>
          <th width="25%"><a>名称</a></th>
          <th><a>是否显示</a></th> 
          <th><a>是否新窗口</a></th>
          <th><a>排序</a></th>
          <th><a>位置</a></th>
          <th width="10%"><a>操作</a></th>
        </tr>
      </thead>
      <tbody>
      	<?php  $_smarty_tpl->tpl_vars['list'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['list']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['nav_list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['list']->key => $_smarty_tpl->tpl_vars['list']->value){
$_smarty_tpl->tpl_vars['list']->_loop = true;
?>
      	<tr>
          <td></td>
          <td><?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
</td><!--编号-->
          <td><?php echo $_smarty_tpl->tpl_vars['list']->value['name'];?>
</td><!--名称-->
          <td><i style="cursor:pointer;" onclick="ajax_enabled(this,<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
,<?php echo $_smarty_tpl->tpl_vars['list']->value['ifshow'];?>
)" class="fa <?php if ($_smarty_tpl->tpl_vars['list']->value['ifshow']==1){?>fa-close <?php }else{ ?>fa-check<?php }?>"></i></td>
          <td><i style="cursor:pointer;" onclick="ajax_new(this,<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
,<?php echo $_smarty_tpl->tpl_vars['list']->value['opennew'];?>
)" class="fa <?php if ($_smarty_tpl->tpl_vars['list']->value['opennew']==1){?>fa-close <?php }else{ ?>fa-check<?php }?>"></i></td>
          <td><?php echo $_smarty_tpl->tpl_vars['list']->value['vieworder'];?>
</td><!--排序-->
          <td><?php if ($_smarty_tpl->tpl_vars['list']->value['type']=='middle'){?>
                中间
              <?php }?>
              <?php if ($_smarty_tpl->tpl_vars['list']->value['type']=='top'){?>
                上
              <?php }?>
              <?php if ($_smarty_tpl->tpl_vars['list']->value['type']=='bottom'){?>
                下
              <?php }?>
          </td><!--位置-->
          <td>
            <a href="nav_list.php?act=add&id=<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
">编辑</a>
            <a href="nav_list.php?act=ads_del&id=<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
">删除</a>
          </td>
        </tr>
        <?php } ?>
      </tbody>
    </table>
    <div class="page"><?php echo $_smarty_tpl->tpl_vars['page']->value;?>
</div>
</div>
</body>
<script>
function ajax_enabled(obj,id,price){
  if(price==1){
    prices="1";
  }else{
    prices="2";
  }
  $.post("nav_list.php",{act:'ajax_enabled',id:id,show:prices},function(data){
      if(data==1){
      layer.msg("操作成功！");
      if(prices==1){
        $(obj).attr("onclick","ajax_enabled(this,"+id+",2)");
        $(obj).removeClass("fa-close");
        $(obj).addClass("fa-check");
      }else if(prices==2){
        $(obj).attr("onclick","ajax_enabled(this,"+id+",1)");
        $(obj).removeClass("fa-check");
        $(obj).addClass("fa-close");
      }
    }else if(data==2){
      layer.msg("操作失败！");
    }
  });  
}
function ajax_new(obj,id,price){
  if(price==1){
    prices="1";
  }else{
    prices="2";
  }
  $.post("nav_list.php",{act:'ajax_new',id:id,news:prices},function(data){
      if(data==1){
      layer.msg("操作成功！");
      if(prices==1){
        $(obj).attr("onclick","ajax_new(this,"+id+",2)");
        $(obj).removeClass("fa-close");
        $(obj).addClass("fa-check");
      }else if(prices==2){
        $(obj).attr("onclick","ajax_new(this,"+id+",1)");
        $(obj).removeClass("fa-check");
        $(obj).addClass("fa-close");
      }
    }else if(data==2){
      layer.msg("操作失败！");
    }
  });  
}
</script>
</html>
<?php }} ?>